/*
 * This file is part of WebCL – JavaScript bindings for OpenCL
 * http://webcl.nokiaresearch.com/
 *
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 *
 * Contact: Jari Nikara  ;jari.nikara@nokia.com;
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 *
 * The package is based on a published Khronos OpenCL 1.1 Specification,
 * see http://www.khronos.org/opencl/.
 *
 * OpenCL is a trademark of Apple Inc.
 */

#ifndef _WEBCL_LIBCL_H_
#define _WEBCL_LIBCL_H_

#include "nsISupports.h"
#include "nsStringAPI.h"

struct WebCL_CLSymbols;
class PRLibrary;

class WebCL_LibCL : public nsISupports
{
public:
  NS_DECL_ISUPPORTS
  virtual ~WebCL_LibCL ();

  char const* const libName () const;

  static bool load (char const* aLibPath, WebCL_LibCL** aInstanceOut,
                    nsCString* aErrorMessageOut = 0);

  WebCL_CLSymbols* symbols;

private:
  static void unload (WebCL_LibCL* aLib);

  WebCL_LibCL ();

  char const* m_libName;
  PRLibrary* m_libHandle;
};


#endif //_WEBCL_LIBCL_H_
